package linear.stack;

/**
 * @Author: fzykd
 * Date: 2024-04-11
 * Time: 21:24
 * User: LQH
 */


public class StackMain {
    public static void main(String[] args) {

        ArrayStack arrayStack = new ArrayStack(5);

        arrayStack.push(1);
        arrayStack.push(2);
        arrayStack.push(3);
        arrayStack.push(4);
        arrayStack.push(5);
        arrayStack.push(6);


        System.out.println(arrayStack.peek());
        //返回栈顶元素 并出栈
        System.out.println(arrayStack.pop());
        //返回栈底元素 不出栈
        System.out.println(arrayStack.peek());


    }
}
